<!---
	Copyright 2010 Edward Trudeau, Jeremy Battle
    This software is freely available under the MIT License: http://www.opensource.org/licenses/mit-license.php
    http://ayc.googlecode.com
    
--->

<cfcomponent name="Permission" output="false" extends="_Permission">
	
    <cfset variables.OTService = "" />
    
    <cffunction name="setObjectTypeService" output="no" returntype="void" hint="I set the Object Service required to determine which object type a permission applies to">
    	<cfargument name="OTService" type="ayc.cfc.object.ObjTypeService" required="yes" />
        
       <cfset variables.OTService = arguments.OTService />
    </cffunction>
    
    <cffunction name="getObjectType" access="public" output="no" hint="I return the name of the object type this permission applies to">
    	<cfif NOT isObject(variables.OTService)>
        	<cfset setObjectTypeService(request.OTS) />
        </cfif>
    
    	<cfreturn variables.OTService.getObjectTypeName(this.getObjectTypeId()) />
    </cffunction>
   
</cfcomponent>


